﻿<!DOCTYPE html>
<!--基于风险信息库的安全措施-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    
<div id="app" v-cloak>   
        <div style="width:100% ">
            <label style="font-weight:bold">基于风险信息库的安全措施</label>
        </div>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%">
            <el-row>
                <el-col span="12">
                    1. 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="12">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">添加作业步骤</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.RiskIdentificationSafety"
                              border
                              style="width:90%">
                        <el-table-column prop="WorkProcedure"
                                         :label="JSPAnalyticalManagement.WorkProcedure">
                        </el-table-column>
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirements"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">

                                <el-button @click.native.prevent="UserInput('tj')"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>


                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.RiskIdentificationSafety)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="12">
                    2. 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="12">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">添加作业步骤</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.RiskIdentificationSafety"
                              border
                              style="width:90%">
                        <el-table-column prop="WorkProcedure"
                                         :label="JSPAnalyticalManagement.WorkProcedure">
                        </el-table-column>
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirements"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">

                                <el-button @click.native.prevent="UserInput('tj')"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>


                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.RiskIdentificationSafety)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="12">
                    3. 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="12">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">添加作业步骤</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.RiskIdentificationSafety"
                              border
                              style="width:90%">
                        <el-table-column prop="WorkProcedure"
                                         :label="JSPAnalyticalManagement.WorkProcedure">
                        </el-table-column>
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirements"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">

                                <el-button @click.native.prevent="UserInput('tj')"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>


                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.RiskIdentificationSafety)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>


            <el-row>
                <el-col span="12">
                    4. 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="12">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">添加作业步骤</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.RiskIdentificationSafety"
                              border
                              style="width:90%">
                        <el-table-column prop="WorkProcedure"
                                         :label="JSPAnalyticalManagement.WorkProcedure">
                        </el-table-column>
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirements"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">

                                <el-button @click.native.prevent="UserInput('tj')"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>


                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.RiskIdentificationSafety)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>


            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

        <el-dialog title="添加作业步骤" :visible.sync="ListItem.dialogVisible" width="60%" height="90%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:400px;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                Form: {
                    RiskIdentificationSafety: '',//风险识别及安全措施
                },
                JobApproverDepartment: [],
                Approver: [],
                rules: {},
                ListItem: ListItem,

            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getData(this, '/api/JSPAnalyticalManagement/get?id=' + this.id);
                },
                UserInput: function (val, id) { DialogShow(this, val, "ParticipateJSPAnalystsInput.html", id); },
                // SpecialJob: function (val, id) { DialogShow(this, val, "ParticipateJSPAnalystsInput.html", id); },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    //this.$refs[formName].validate(function (valid) {
                    //    //验证通过
                    //    if (valid) {
                    onSubmitForm(this, '/api/JSPAnalyticalManagement/Save', mythis.Form);
                    //} else {
                    //    //验证失败
                    //    return false;
                    //}
                    //});
                },
            },
            mounted: function () {

                var list = getDicDataArray(['14', '16']);

                this.JobApproverDepartment = getDicDatafromArray('14', list);
                this.Approver = getDicDatafromArray('16', list);
                this.id = getUrlParam("id");
                this.getData();
                if (this.id == null) {
                    //getData(this, '/api/JobLicenseManagement/getA?id=' + this.id);
                    this.Form.OperatingUnit = "作业单位";
                    this.Form.ApplicationNumber = "申请编号";
                    this.Form.ApplicationTime = "2019-05-30";
                    this.Form.JobManagere = "作业负责人";
                }
            }
        });
    </script>
</body>


</html>